package chenji.dailykit.kit.kits;

import java.util.logging.Level;

import org.bukkit.configuration.file.FileConfiguration;

import chenji.dailykit.Main;
import chenji.dailykit.kit.SimpleKit;

/**
 * @author ChenJi Copyright (c) 2016 ChenJi. All rights reserved.
 */
public class DailyKit extends SimpleKit {
	int Daily;
	int DailyLimit;
	String Permission;

	@Override
	public String getName() {
		return "DailyKit";
	}

	@Override
	public boolean loadSettingsPath(FileConfiguration f, String Path) {
		int daily = f.getInt(Path + ".settings.Daily");
		if (daily <= 0) {
			StringBuilder s = new StringBuilder();
			s.append("加载礼包");
			s.append("时发生异常：未找到");
			s.append(Path);
			s.append("节点或其对应值等于非正数");
			Main.getLog().log(Level.WARNING, s.toString());
			return false;
		}
		int limit = f.getInt(Path + ".settings.Daily");
		if (limit <= 0) {
			StringBuilder s = new StringBuilder();
			s.append("加载礼包");
			s.append("时发生异常：未找到");
			s.append(Path);
			s.append("节点或其对应值等于非正数");
			Main.getLog().log(Level.WARNING, s.toString());
			return false;
		}

		return false;

	}

}
